/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoopp.framework;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public final class d {
    private final String d = "FormFile";
    private byte[] e;
    InputStream a = null;
    File b;
    String c;
    private String f = "360zhifu/error_param";
    private String g = "UTF-8";

    public d(String paramString, File paramFile) {
        this.c = paramString;
        LogUtil.w("FormFile", "FormFile, file_send_name is : " + paramString);
        this.b = paramFile;
        try {
            this.a = new FileInputStream(paramFile);
            return;
        } catch (FileNotFoundException localFileNotFoundException) {
            localFileNotFoundException.printStackTrace();
        }
    }

    public final byte[] a() {
        if (this.e != null)
            return this.e;
        if (this.b != null) {
            if (this.a == null)
                this.a = new FileInputStream(this.b);
            byte[] arrayOfByte = new byte[(int) this.b.length()];
            int i = 0;
            int j = 0;
            while ((i < arrayOfByte.length) && ((j = this.a.read(arrayOfByte, i, arrayOfByte.length)) >= 0))
                i += j;
            this.a.close();
            this.a = null;
            if (i == (int) this.b.length())
                return arrayOfByte;
            LogUtil.w("FormFile", "getData, offset_file != (int) file.length()!");
            return null;
        }
        LogUtil.w("FormFile", "getData, file is null!");
        return null;
    }
}